<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/jquery-1.9.0.min.js"></script>
</head>
<body>
<h1>Storage Event</h1>
<ul>
</ul>
</body>
</html>
<script>
    function list(){
        var storge=window.localStorage;
        for(var i=0;i<storge.length;++i){
            var key=storge.key(i);
            $("ul").append("<li id="+key+">"+key+","+storge.getItem(key)+"</li>");
        }
    }

    function fun(e){
        console.log(e.key);
        console.log(e.oldValue+" old value");
        console.log(e.newValue+" new value");
        console.log(e.url);
        console.log("--------------------");
        list();
    }
    window.addEventListener("storage",fun,true);

    $(function () {
        list();
    })
</script>